﻿using Bandit.Helpers;
using Bandit.UI.MVVM;
using BeanGo.DataGridDemo.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace BeanGo.DataGridDemo.ViewModels
{
    public class MainViewModel : NotifyObject
    {
        #region TestInfo
        /// <summary>
        /// Test Information
        /// </summary>
        public TestInfo TestInfo { get; private set; }
        #endregion

        /// <summary>
        /// Test Config
        /// </summary>
        public Core.TestConfig TestConfig
        {
            get
            {
                return Core.TestConfig.Instance;
            }
        }

        #region Setting
        /// <summary>
        /// Setting
        /// </summary>
        public Setting Setting { get { return App.SettingViewModel.Setting; } }
        #endregion

        #region IsEngineer
        private bool _IsEngineer;
        /// <summary>
        /// IsEngineer
        /// </summary>
        public bool IsEngineer
        {
            get { return _IsEngineer; }
            set
            {
                _IsEngineer = value;
                OnPropertyChanged("IsEngineer");
            }
        }
        #endregion

        #region OnClick
        /// <summary>
        /// Click Event
        /// </summary>
        public ICommand OnClick { get; set; }
        #endregion

        #region Status

        /// <summary>
        /// 状态
        /// </summary>
        public Status Status { get; set; }

        #endregion

        #region UsbStatus

        /// <summary>
        /// Usb状态
        /// </summary>
        public Status UsbStatus { get; set; }

        #endregion

        #region EngineerMode
        private bool _EngineerMode;
        /// <summary>
        /// 启用为工程师模式
        /// </summary>
        public bool EngineerMode
        {
            get { return _EngineerMode; }
            set
            {
                _EngineerMode = value;
                OnPropertyChanged("EngineerMode");
            }
        }
        #endregion

        #region Constructors[构造函数]

        public MainViewModel()
        {
            this.TestInfo = new TestInfo();

            this.Status = new Status(App.GetString("Ready"), MyBrushes.White);

            this.UsbStatus = new Status(App.GetString("USB is not connected!"), MyBrushes.Red);
        }

        #endregion
    }
}
